package com.wandian.ui.skins
{
	import flash.display.Graphics;
	import flash.filters.GlowFilter;

	public class TextInputSkin extends Skin
	{
		public static var focusFilter:GlowFilter=new GlowFilter()

		public function TextInputSkin()
		{
			super();
		}

		override public function updateDisplay(w:int, h:int, state:String, ... args):void
		{
			var backgroundColor:int=getStyle("backgroundColor");
			var borderColor:int=getStyle("borderColor");
			var focusColor:int=getStyle("focusColor");
			var radius:int=getStyle("cornerRadius") * 2;
			var g:Graphics=this.graphics
			g.clear();

			g.beginFill(backgroundColor)
			g.drawRoundRect(0, 0, w, h, radius, radius);
			g.endFill()
			switch (state)
			{
				case "focusIn":
					focusFilter.color=focusColor
					this.filters=[focusFilter]
					break;
				default:
					this.filters=[];
			}
		}
	}
}
